﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>收货地址 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link rel="stylesheet" type="text/css" href="{config.webpath}scripts/artdialog/ui-dialog.css" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/css/style.css" />
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/common.js"></script>
<script type="text/javascript">
	function ExecPostBack(checkValue) {
		if (arguments.length == 1) {
			ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_address_delete', checkValue, '#turl');
		}else{
			var valueArr = '';
			$("input[name='checkId']:checked").each(function(i){
				valueArr += $(this).val();
				if(i < $("input[name='checkId']:checked").length - 1){
					valueArr += ","
				}
			});
			ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_address_delete', valueArr, '#turl');
		}
    }
</script>
</head>

<body>
<!--页面头部-->
<%template src="_header.html"%>
<!--/页面头部-->

<!--当前位置-->
<div class="section">
    <div class="location">
        <span>当前位置：</span>
        <a href="<%linkurl("index")%>">首页</a> &gt;
        <a href="<%linkurl("usercenter","index")%>">会员中心</a>
        <a href="<%linkurl("useraddress")%>">收货地址</a>
    </div>
</div>
<!--/当前位置-->

<div class="section clearfix">
    <!--页面左边-->
    <%template src="_ucenter_nav.html"%>
    <!--/页面左边-->
    
    <!--页面左边-->
    <div class="right-auto">
        <div class="bg-wrap" style="min-height:765px;">
            <!--收货地址列表-->
            <div class="sub-tit">
                <a class="add" href="<%linkurl("useraddress_edit","add")%>"><i class="iconfont icon-plus"></i>新增地址</a>
                <ul>
                    <li class="selected">
                        <a href="<%linkurl("useraddress")%>">收货地址</a>
                    </li>
                </ul>
            </div>
            
            <div class="table-wrap">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ftable">
                    <tr>
                        <th width="30">选择</td>
                        <th align="left">收货地址</td>
                        <th width="18%" align="left">手机</td>
                        <th width="20%" align="left">邮箱</td>
                        <th width="100">操作</td>
                    </tr>
                    <%set DataTable list=get_user_addr_book_list(15, page, "user_id="+userModel.id, out totalcount)%><!--取得一个DataTable-->
                    <%set string pagelist=get_page_link(15, page, totalcount, "useraddress", "__id__")%> <!--取得分页页码列表-->
                    <%foreach(DataRow dr in list.Rows)%>
                    <tr>
                        <td width="20" align="center">
                            <input name="checkId" class="checkall" type="checkbox" value="{dr[id]}" >
                        </td>
                        <td>
                            ({dr[accept_name]}) {dr[area]} {dr[address]}
                        </td>
                        <td>{dr[mobile]}</td>
                        <td>{dr[email]}</td>
                        <td align="center">
                            <a href="<%linkurl("useraddress_edit","edit",{dr[id]})%>">编辑</a> | 
                            <%if({dr[is_default]}=="0")%>
                                <a onclick="clickSubmit('{config.webpath}tools/submit_ajax.ashx?action=user_address_default&id={dr[id]}')" href="javascript:;">设为默认</a>
                            <%else%>
                                已默认
                            <%/if%> 
                        </td>
                    </tr>
                    <%/foreach%>
                    <%if(list.Rows.Count==0)%>
                    <tr><td colspan="5" align="center">暂无记录...</td></tr>
                    <%/if%>
                </table>
                
                <div class="page-foot">
                    <div class="flickr right">{pagelist}</div><!--放置页码列表-->
                    <div class="btn-box">
                        <a onclick="checkAll(this);" href="javascript:;">全选</a>
                        <a onclick="ExecPostBack();" href="javascript:;">删除</a>
                    </div>
                </div>
            </div>
            <input id="turl" type="hidden" value="<%linkurl("useraddress")%>" /><!--存在跳转的URL值-->
            <!--/收货地址列表-->
        </div>
    </div>
    <!--/页面左边-->
</div>

<!--页面底部-->
<%template src="_footer.html"%>
<!--/页面底部-->
</body>
</html>